{% extends "ui/base.html" %}
{% load url from future %}
{% load icons %}
{% load formats %}
{% load bob %}

{% block sidebar %}
{% if sidebar_items %}
{% sidebar_menu sidebar_items sidebar_selected %}
{% endif %}

{% if searchform %}
<form class="form search-form well well-small"
{% if not searchform_filter %}action="{% url 'search' details '' %}"{% endif %} >
{% for f in searchform %}
{% if 'data-collapsed' not in f.field.widget.attrs %}
<div class="control-group {{ f.css_classes }} {% if f.errors %}error{% endif %}">
{{ f.label_tag }}
{{ f }}
{%  for e in f.errors %}
<div class="help-block">{{ e }}</div>
{%  empty %}
{%   if f.help_text %}
<div class="help-block">{{ f.help_text }}</div>
{%   endif %}
{%  endfor %}
</div>
{% endif %}
{% endfor %}
{% if not searchform_filter %}
<div class="control-group">
{% spaceless %}
<a href="#form-collapsed" data-toggle="collapse" class="btn" style="width:80%">
    {% icon 'fugue-ui-accordion' %}&nbsp;More&hellip;
</a>
{% endspaceless %}
</div>
<div class="collapse" id="form-collapsed">
{% for f in searchform %}
{% if 'data-collapsed' in f.field.widget.attrs %}
<div class="control-group {{ f.css_classes }} {% if f.errors %}error{% endif %}">
{{ f.label_tag }}
{{ f }}
{%  for e in f.errors %}
<div class="help-block">{{ e }}</div>
{%  empty %}
{%   if f.help_text %}
<div class="help-block">{{ f.help_text }}</div>
{%   endif %}
{%  endfor %}
</div>
{% endif %}
{% endfor %}
</div>
{% endif %}

{% if searchform_filter %}
<button type="submit" class="btn btn-primary">
    {% icon 'fugue-funnel' %}&nbsp;Filter
</button>
{% else %}
<button type="submit" class="btn btn-primary">
    {% icon 'fugue-magnifier' %}&nbsp;Search
</button>
{% endif %}
</form>
{% endif %}
{% endblock %}


{% block titlesubsection %}{% if subsection %}
{%   if details %}
{{ details.title }} -
{%   endif %}
{%   if device %}
{{ device.name }} -
{%   endif %}
{{ subsection.title }} -
{% endif %}{% endblock %}


{% block tabs %}
{%   if subsection != None or show_tab_menu %}
{%     if details %}
{%       tab_menu tab_items details %}
{%     endif %}
{%   endif %}
{% endblock %}

{% block breadcrumbs %}
{% if subsection or subsection == '' %}
<ul class="breadcrumb">
    <li><a href="../..">{{ active_submodule|title }}</a> <span class="divider">/</span></li>
    <li><a href="../{{ details }}?{{ url_query.urlencode }}">{{ subsection|default:'unknown' }}</a> <span class="divider">/</span></li>
  <li class="active">{{ device.name }}</li>
</ul>
{% endif %}
{% endblock %}

